package com.example.myapplication;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
public class MidReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        Log.e("MidReceiver","onReceive");
        Bundle bundle=getResultExtras(false);
        String name =bundle.getString("NAME");
        int age =bundle.getInt("AGE");
        Log.e("MidReceiver",
                "上一个接收者的姓名"+name
                        +",年龄"+age);
        bundle.putString("NAME","mayun");
        bundle.putInt("AGE",50);
        setResultExtras(bundle);

        abortBroadcast();//使广播终止
    }
}
